<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTradingSpotAccountCapitalflowsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('trading_spot_account_capitalflows', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('coin_id')->unsigned()->comment('币种id');
            $table->integer('user_id')->unsigned()->comment('用户id');
            $table->decimal('available_before', 20, 8)->unsigned()->comment('可用余额-操作前');
            $table->decimal('available_number', 20, 8)->comment('可用余额-操作数量');
            $table->decimal('available_after', 20, 8)->unsigned()->comment('可用余额-操作后');
            $table->decimal('disabled_before', 20, 8)->unsigned()->comment('冻结余额-操作前');
            $table->decimal('disabled_number', 20, 8)->comment('冻结余额-操作数量');
            $table->decimal('disabled_after', 20, 8)->unsigned()->comment('冻结余额-操作后');
            $table->bigInteger('certificate')->unsigned()->comment('凭证号');
            $table->integer('proof_id')->comment('凭证Id');
            $table->integer('class_id')->comment('类编码');
            $table->integer('op_id')->comment('操作编码');
            $table->integer('version')->comment('版本号');
            $table->boolean('is_checked')->default(0)->comment('状态 0未检测 1已通过');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('trading_spot_account_capitalflows');
    }
}
